
function setHeader(currentMenu) {
	$("li", $("#header-nav")).removeClass("active");
	$("#" + currentMenu, $("#header-nav")).addClass("active");
}
function setOperate(currentMenu) {
	$("li", $("#operate-nav")).removeClass("active");
	$("#" + currentMenu, $("#operate-nav")).addClass("active");
}
!function ($) {
	"use strict"; // jshint ;_;
	var NScrollSpy = function (element, options) {
		var process = $.proxy(this.process, this), $element = $(element).is("body") ? $(window) : $(element), href;
		this.options = $.extend({}, $.fn.scrollspy.defaults, options);
		this.$scrollElement = $element.on("scroll.scroll-spy.data-api", process);
		this.selector = (this.options.target || ((href = $(element).attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "")) || "") + " .nav li > a";
		this.$body = $("body");
		this.refresh();
		this.process();
	};
	/* NOTE: NScrollSpy EXTENDS BOOTSTRAP-ScrollSpy.js
     ========================================== */
	NScrollSpy.prototype = $.extend({}, $.fn.scrollspy.Constructor.prototype, {constructor:NScrollSpy, process:function () {
		var scrollTop = this.$scrollElement.scrollTop() + this.options.offset, scrollHeight = $(document).height(), maxScroll = scrollHeight - this.$scrollElement.height(), offsets = this.offsets, targets = this.targets, activeTarget = this.activeTarget, i;
		if (scrollTop >= maxScroll) {
			return activeTarget != (i = targets.last()[0]) && this.activate(i);
		}
		for (i = offsets.length; i--; ) {
			activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) && this.activate(targets[i]);
		}
	}});
	/* NSCROLLSPY PLUGIN DEFINITION
  * =========================== */
	$.fn.nscrollspy = function (option) {
		return this.each(function () {
			var $this = $(this), data = $this.data("nscrollspy"), options = typeof option == "object" && option;
			if (!data) {
				$this.data("nscrollspy", (data = new NScrollSpy(this, options)));
			}
			if (typeof option == "string") {
				data[option]();
			}
		});
	};
	$.fn.nscrollspy.Constructor = NScrollSpy;
	/* NCROLLSPY DATA-API
  * ================== */
	$(window).on("load", function () {
		$("[data-spy=\"nscroll\"]").each(function () {
			var $spy = $(this);
			$spy.nscrollspy($spy.data());
		});
	});
}(window.jQuery);

!function ($) {
	"use strict";
	$.fn.persistantPopover = function () {
		var popoverTimeout;
		function delay() {
			popoverTimeout = setTimeout(function () {
				$(".popover").hide();
			}, 100);
		}
		return this.each(function () {
			var $this = $(this);
			$this.popover({trigger:"manual", placement:"right", animation:false, content:"sfsf"});
		}).mouseenter(function () {
			clearTimeout(popoverTimeout);
			$(".popover").remove();
			$(this).popover("show");
		}).mouseleave(function () {
			delay();
			$(".popover").mouseenter(function () {
				clearTimeout(popoverTimeout);
			}).mouseleave(function () {
				delay();
			});
		});
	};
}(window.jQuery);

